<div class="content-section introduction">
    <div>
        <span class="feature-title">ProgressBar</span>
        <span>ProgressBar is a process status indicator.</span>
    </div>
</div>

<div class="content-section implementation">
    <p-growl [(value)]="msgs"></p-growl>

    <h3 class="first">Dynamic</h3>
    <p-progressBar [value]="value"></p-progressBar>

    <h3>Static</h3>
    <p-progressBar [value]="50"></p-progressBar>
    
    <h3>Indeterminate</h3>
    <p-progressBar mode="indeterminate" [style]="{'height': '6px'}"></p-progressBar>
</div>

<div class="content-section documentation">
    <p-tabView effect="fade">
        <p-tabPanel header="Documentation">
            <h3>Import</h3>
<pre>
<code class="language-typescript" pCode ngNonBindable>
import &#123;ProgressBarModule&#125; from 'primeng/progressbar';
</code>
</pre>

            <h3>Getting Started</h3>
            <p>ProgressBar has two modes; "determinate" and "indeterminate". Former requires a value between 0 and 100 to display the progress.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-progressBar [value]="value"&gt;&lt;/p-progressBar&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class ModelComponent &#123;

    value: number = 0;

&#125;
</code>
</pre>
        
            <p>Indeterminate has no such a requirement and is simple enabled using mode property.</p>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-progressBar mode="indeterminate"&gt;&lt;/p-progressBar&gt;
</code>
</pre>

            <h3>Properties</h3>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Type</th>
                            <th>Default</th>
                            <th>Description</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>value</td>
                            <td>number</td>
                            <td>null</td>
                            <td>Current value of the progress.</td>
                        </tr>
                        <tr>
                            <td>showValue</td>
                            <td>boolean</td>
                            <td>true</td>
                            <td>Show or hide progress bar value.</td>
                        </tr>
                        <tr>
                            <td>unit</td>
                            <td>string</td>
                            <td>%</td>
                            <td>Unit sign appended to the value.</td>
                        </tr>
                        <tr>
                            <td>mode</td>
                            <td>string</td>
                            <td>determinate</td>
                            <td>Defines the mode of the progress, valid values are "determinate" and "indeterminate".</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Styling</h3>
            <p>Following is the list of structural style classes, for theming classes visit <a href="#" [routerLink]="['/theming']">theming page</a>.</p>
            <div class="doc-tablewrapper">
                <table class="doc-table">
                    <thead>
                        <tr>
                            <th>Name</th>
                            <th>Element</th>
                        </tr>
                    </thead>
                    <tbody>
                        <tr>
                            <td>ui-progressbar</td>
                            <td>Container element.</td>
                        </tr>
                        <tr>
                            <td>ui-progressbar-determinate</td>
                            <td>Container element of a determinate progressbar.</td>
                        </tr>
                        <tr>
                            <td>ui-progressbar-indeterminate</td>
                            <td>Container element of an indeterminate progressbar.</td>
                        </tr>
                        <tr>
                            <td>ui-progressbar-value</td>
                            <td>Element whose width changes according to value.</td>
                        </tr>
                        <tr>
                            <td>ui-progressbar-label</td>
                            <td>Label element that displays the current value.</td>
                        </tr>
                    </tbody>
                </table>
            </div>

            <h3>Dependencies</h3>
            <p>None.</p>
        </p-tabPanel>

        <p-tabPanel header="Source">
            <a href="https://github.com/primefaces/primeng/tree/master/src/app/showcase/components/progressbar" class="btn-viewsource" target="_blank">
                <i class="fa fa-github"></i>
                <span>View on GitHub</span>
            </a>
<pre>
<code class="language-markup" pCode ngNonBindable>
&lt;p-growl [(value)]="msgs"&gt;&lt;/p-growl&gt;

&lt;h3 class="first"&gt;Dynamic&lt;/h3&gt;
&lt;p-progressBar [value]="value"&gt;&lt;/p-progressBar&gt;

&lt;h3&gt;Static&lt;/h3&gt;
&lt;p-progressBar [value]="50"&gt;&lt;/p-progressBar&gt;

&lt;h3&gt;Indeterminate&lt;/h3&gt;
&lt;p-progressBar mode="indeterminate" [style]="&#123;'height': '6px'&#125;"&gt;&lt;/p-progressBar&gt;
</code>
</pre>

<pre>
<code class="language-typescript" pCode ngNonBindable>
export class ProgressBarDemo &#123;

    value: number = 0;

    msgs: Message[];

    ngOnInit() &#123;
        let interval = setInterval(() => &#123;
            this.value = this.value + Math.floor(Math.random() * 10) + 1;
            if(this.value >= 100) &#123;
                this.value = 100;
                this.msgs = [&#123;severity: 'info', summary: 'Success', detail: 'Process Completed'&#125;];
                clearInterval(interval);
            &#125;
        &#125;, 2000);
    &#125;

&#125;
</code>
</pre>
        </p-tabPanel>
    </p-tabView>
</div>